package cm.baidu.note.service.impl;

import cm.baidu.note.domain.User;
import cm.baidu.note.service.INoteService;
import cm.baidu.note.util.SendSmsUtil;
import cm.baidu.note.util.SendStatusStatisticsUtil;
import com.tencentcloudapi.sms.v20210111.models.SendStatusStatisticsResponse;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;


@Service
public class NoteServiceImpl implements INoteService {
    @Value("${note.secretId}")
    private String secretId;
    @Value("${note.secretKey}")
    private String secretKey;

    @Override
    public User send(Long userId, String phone) {
        return SendSmsUtil.send(userId, phone, secretId, secretKey);
    }

     @Override
     public SendStatusStatisticsResponse SendStatusStatistics(String beginTime, String endTime) {
         return SendStatusStatisticsUtil.StatisticalSms(beginTime,endTime,secretId,secretKey);
     }
}
